/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package CDB;

import java.sql.Statement;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;

/**
 *
 * @author ISCErick
 */
public class AccionMySQL {

    private ConexionMySQL conexion;
    public ResultSet resultadoConsulta;
    private ResultSetMetaData metaDatos;
    private String consulta;

    public void DeleteByTabla(String tabla, String nombreID, int id) throws SQLException {
        conexion = new ConexionMySQL("localhost", "root", "rdx06082013elmdrg", "salestedispatcher");
        consulta = "DELETE FROM " + tabla + " WHERE " + nombreID + " = " + id;
        Statement st = conexion.conexion.createStatement();
        st.executeQuery(consulta);
        st.close();
        conexion.cierraConexion();
    }
}
